<template>
  <div class="pay">
    <div class="pay-first">
      <div class="first-title" style="color: #0070ba;font-size: 20px">ANBIO BIOTECHNOLOGY</div>
      <div class="first-title">Account Balance</div>
      <div class="first-price">
        <div class="price-text">
          ${{Balance}}<span style="margin-left: 5px">USD</span>
        </div>
        <div class="ahits">available</div>
      </div>

      <div class="first-block">
        <div class="block-title">Currencies</div>
        <div class="block-view">
          <div class="view-header">
            <div class="left">

              <div class="left-title">US Dollar</div>
            </div>

            <div class="right">${{Balance}}</div>
          </div>
          <div class="view-tags">Primary</div>
          <div class="view-text">Convert currency</div>
        </div>

        <div class="block-title">Banks</div>
        <div class="block-list" @click="bankStop(0)">
          <div class="list">
            <div class="list-img"><img class="list-img" src="../../assets/bank.png"></div>
            <div class="list-title">Link a bank</div>
          </div>
        </div>

        <div class="block-title">Credit and Debit Cards</div>
        <div class="block-list" @click="bankStop(1)">
          <div class="list">
            <div class="list-img"><img  class="list-img" src="../../assets/credit.png"></div>
            <div class="list-title">Link a card</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

  <script>
import {loadBalanceInfo} from "@/api";

export default {
  data() {
    return {
      payShow: false,
      Balance :0,
    };
  },
  mounted() {
    this.LoadBalanceInfo();
  },
  methods: {
    bankStop(index) {
      this.$router.push({
        path: "/main/payouts",
        query: {
          payoutsTrue: index,
        },
      });
    },
    formatNumber(number) {
      return number.toFixed(2);
    },
    LoadBalanceInfo()
    {
      debugger
      loadBalanceInfo().then((res) => {
        if (res.success == true) {
          this.Balance = this.formatNumber(res.result.money);
          this.Money_in =this.formatNumber (res.result.fundMoney);
          this.Money_out = this.formatNumber(res.result.fmoney);

        }
      });
    }
  },
};
</script>

  <style lang="less" scoped>
.pay {
  min-height: calc(100vh - 70px);
  background: #fff;

  .pay-first {
    .first-title {
      padding: 40px 200px 0;
      box-sizing: border-box;
      font-size: 18px;
      font-weight: 500;
      text-align: left;
    }


    .ahits
    {
      font-size: 18px;
      margin-top: 15px;
    }

    .first-price {
      background: #faf8f5;
      padding: 40px 40px 40px 200px;
      box-sizing: border-box;
      margin-top: 40px;
      text-align: left;

      .price-text {
        color: #0070ba;
        font-weight: 500;
        font-size: 36px;
        letter-spacing: 1px;
      }

      .price-title {
        margin-top: 5px;
        color: #000;
        font-size: 14px;
        font-weight: 500;
      }
    }

    .first-block {
      text-align: left;
      padding: 20px 200px 0;
      box-sizing: border-box;

      .block-title {
        font-size: 20px;
        font-weight: 500;
        margin-bottom: 20px;
      }

      .block-view {
        border: 1px solid #eee;
        padding: 20px;
        box-sizing: border-box;
        width: 25%;
        margin-bottom: 20px;
        border-radius: 5px;

        .view-header {
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 15px;
          .left {
            display: flex;
            align-items: center;
            .left-img {
              width: 40px;
              height: 20px;
              margin-right: 10px;
              border: 1px solid;
            }

            .left-title {
              font-size: 16px;
              font-weight: 500;
            }
          }

          .right {
            font-size: 24px;
            color: #0070ba;
            font-weight: 600;
          }
        }

        .view-tags {
          font-size: 14px;
          background: #ddd;
          padding: 5px 10px;
          box-sizing: border-box;
          border-radius: 8px;
          display: inline;
        }

        .view-text {
          margin-top: 15px;
          font-size: 14px;
          font-weight: 500;
          color: #0060df;
        }
      }

      .block-list {
        box-shadow: 1px 1px 10px 3px rgba(0, 0, 0, 0.1);
        width: 200px;
        height: 130px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        margin-bottom: 30px;
        cursor: pointer;
        transition: transform 0.3s ease;
        transform: scale(1);

        .list {
          .list-img {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: #eee;
            margin: 0 auto;


          }

          .list-title {
            font-size: 14px;
            margin-top: 10px;
          }
        }
      }

      .block-list:hover {
        transform: scale(1.1); /* 鼠标移入时放大1.1倍 */
      }
    }
  }
}
</style>
